﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TempPayment.aspx.cs" Inherits="NJL.Web.Shop.TempPayment" %>

<%@ Register Src="/Controls/WUCHeader1.ascx" TagName="WUCHeader1" TagPrefix="uc1" %>
<%@ Register Src="/Controls/WUCFooter1.ascx" TagName="WUCFooter1" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>在线支付-农家乐网</title>
    <link href="/Styles/base1.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/manage.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var t9;
        function check() {
            var txtUserName = document.getElementById("txtUserName");
            if ($.trim(txtUserName.value).length == 0) {
                alert("姓名不能为空哦");
                return false;
            }
            var txtUserMobel = document.getElementById("txtUserMobel");
            if ($.trim(txtUserMobel.value).length == 0) {
                alert("联系电话不能为空哦");
                return false;
            }
            var txtAmount = document.getElementById("txtAmount");
            if ($.trim(txtAmount.value).length == 0) {
                alert("支付金额不能为空哦");
                return false;
            }
            var regFloat = /^([+-]?)((\d{1,3}(,\d{3})*)|(\d+))(\.\d{2})?$/;
            if (txtAmount.value.match(regFloat) == null) {
                alert("请输入正确的金额格式哦,精确到分");
                return false;
            }
            if (txtAmount.value <= 0.00) {
                alert("支付金额不能为0元哦");
                return false;
            }
            t9 = new PopupLayer({ trigger: "#btnSubmit", popupBlk: "#blk9", closeBtn: "#close9", useOverlay: true, useFx: true,
                offsets: {
                    x: 0,
                    y: -41
                }
            });
            t9.doEffects = function (way) {
                if (way == "open") {
                    this.popupLayer.css({ opacity: 0.3 }).show(400, function () {
                        this.popupLayer.animate({
                            left: ($(document).width() - this.popupLayer.width()) / 2,
                            top: (document.documentElement.clientHeight - this.popupLayer.height()) / 2 + $(document).scrollTop(),
                            opacity: 0.8
                        }, 1000, function () { this.popupLayer.css("opacity", 1) } .binding(this));
                    } .binding(this));
                    document.getElementById("userName").innerHTML = document.getElementById("txtUserName").value;
                    document.getElementById("mobel").innerHTML = document.getElementById("txtUserMobel").value;
                    document.getElementById("amount").innerHTML = document.getElementById("txtAmount").value + "元";
                    document.getElementById("use").innerHTML = document.getElementById("txtUse").value;
                }
                else {
                    this.popupLayer.animate({
                        left: this.trigger.offset().left,
                        top: this.trigger.offset().top,
                        opacity: 0.1
                    }, { duration: 500, complete: function () { this.popupLayer.css("opacity", 1); this.popupLayer.hide() } .binding(this) });
                }
            }

        }
        function closediv() {
            t9.close();
        }
        function tempPayment() {
            var userName = document.getElementById("txtUserName").value;
            var txtUserMobel = document.getElementById("txtUserMobel").value;
            var txtAmount = document.getElementById("txtAmount").value;
            var txtUse = document.getElementById("txtUse").value;
            $.ajax({
                type: 'post',
                url: '/Handle/Handler.ashx',
                data: 'tempOrder=<%=Request["id"] %>&userName=' + userName + '&userMobel=' + txtUserMobel + '&Amount=' + txtAmount + '&txtUse=' + txtUse,
                dataType: 'text',
                success: function (msg) {
                    var typeId = '<%=Request["id"] %>';
                    if (msg != "false") {
                        document.getElementById("hidOrderId").value = msg;
                        if (typeId == '1') {
                            document.getElementById("form1").action = "/Payment/alipay2/default.aspx";
                        }
                        else if (typeId == '2') {
                            document.getElementById("form1").action = "/Payment/tenpay/index.aspx";
                        }
                        document.getElementById("form1").submit();
                    }
                },
                error: function () {

                }
            });
        }
    </script>
</head>
<body>
    <uc1:WUCHeader1 ID="WUCHeader11" runat="server" />
    <div class="reg w1003" style="overflow: hidden">
        <div class="paycont">
            <div class="f_right m_top_20">
                <img src="/Images/paytips.jpg" alt="支付提示" />
                <p class="payphone m_top_20">
                    <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1615605795&site=qq&menu=yes">
                        <img border="0" src="http://wpa.qq.com/pa?p=2:1615605795:42" alt="点击这里给我发消息" title="点击这里给我发消息" />
                    </a>
                </p>
            </div>
            <div>
                <%if (Request["id"] == "1")
                  {
                %>
                <img src="/Images/zf1.jpg" />
                <%
                   
                    }
                  else
                  {
                %>
                <img src="/Images/zf2.jpg" />
                <%
                    }
                %>
            </div>
            <form id="form1" method="post">
            <div class="payInfo">
                <p class="orange">
                    *请确认以下信息，然后提交支付。</p>
                <p>
                    姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：
                    <input id="txtUserName" name="txtUserName" type="text" class="input" maxlength="10" />
                </p>
                <p>
                    联系电话：
                    <input id="txtUserMobel" name="txtUserMobel" type="text" class="input" maxlength="20" />
                </p>
                <p>
                    支付金额：
                    <input id="txtAmount" name="txtAmount" type="text" class="input" maxlength="8" style="width: 60px" />
                    &nbsp;元/人民币<span class="orange">*</span>
                </p>
                <p>
                    用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;途：
                    <textarea id="txtUse" name="txtUse" cols="50" rows="10" class="input" style="height: 50px"></textarea>
                </p>
                <p class="m_top_10 payBtn">
                    <input id="hidOrderId" type="hidden" name="hidOrderId" />
                    <input id="btnSubmit" type="button" value="提 交" class="redbtn" onclick="check()" />
                </p>
            </div>
            </form>
        </div>
    </div>
    <!--弹出层-->
    <div id="blk9" class="blk paypop">
        <div class="popup_title">
            <span class="f_right"><a href="javascript:void(0)" id="close9">关闭</a></span>
            <ul>
                <li class="now"><a href="javascript:void(0)">确认支付</a></li>
            </ul>
        </div>
        <div class="paypopcont cont">
            <!--按钮-->
            <div class="zhifupop">
                <input type="button" value="确认支付" class="zhifubtn" onclick="tempPayment()" />
            </div>
            <p>
                姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：<span class="orange" id="userName"></span></p>
            <p>
                联系电话：<span class="orange" id="mobel"></span></p>
            <p>
                支付金额：<span class="orange" id="amount"></span></p>
            <p>
                用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;途：<span class="orange" id="use"></span></p>
        </div>
    </div>
    <uc2:WUCFooter1 ID="WUCFooter11" runat="server" />
</body>
</html>
